package com.yyq.sos.dao;

import java.io.Serializable;
import java.util.List;

import org.hibernate.Session;
import org.hibernate.SessionFactory;

public interface BaseDao {
	List list(Class cls);
	List list(String sql);
	List listPage(Class cls,int page,int size);
	List listPage(String hql,int page,int size);
	Serializable add(Object obj);
	Serializable[] add(Object[] objs);
	boolean delete(Object obj);
	boolean delete(Class cls, long id);
	boolean delete(Class cls, Serializable id);
	boolean delete(Class cls, long[] ids);
	boolean delete(Class cls, Serializable[] ids);
	boolean delete(String hql);
	boolean update(Object obj);
	boolean update(String hql);
	boolean update(Object[] objs);
	Object findByPk(Class cls, Serializable id);
	Object findByPk(Class cls, long id);
	Object findByPk(String hql);
	List search(String hql);
	List search(String hql, int page, int size);
	long count(Class cls);
	long count(String hql);
	boolean exist(String hql);
	boolean exist(Class cls, Serializable id);
	Object max(Class cls,String fieldName,String where);
	boolean execSql(String sql);
	List listSql(String sql);
	List listSql(String sql,int page,int size);
	public boolean validDateAvai(Class cls,String valueCondition,String effDate,String expDate);
	public Serializable buildPrimaryKey(Object obj);
	SessionFactory getSessionFactory();
	String getTableName(Class cls);
	boolean logicDelete(Serializable[] ids);
	boolean execHql(String sql);
}
